package com.ititer.dao.impl;

import static com.ititer.util.MyBatisCriteriaFactory.newCriteria;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ititer.dao.CodeDictionaryDao;
import com.ititer.mapper.CodeDictionaryMapper;
import com.ititer.model.CodeDictionary;
import com.ititer.model.CodeDictionaryCriteria;

@Repository
public class CodeDictionaryDaoImpl implements CodeDictionaryDao {
	@Autowired
	private CodeDictionaryMapper mapper;

	@Override
	public List<CodeDictionary> getByType(String type) {
		//TODO add order by
		CodeDictionaryCriteria example = newCriteria(CodeDictionaryCriteria.class);
		example.createCriteria().andTypeEqualTo(type);
		return mapper.selectByExample(example);
	}

}
